"use strict";

angular.module('app.user', ['ui.router'])
.config(function ($stateProvider,ACCESS_LEVELS) {
    $stateProvider
        .state('app.user', {
            abstract: true,
            data: {
                title: '用户管理'
            }
        })
        .state('app.user.System', {
            url: '/System',
            views: {
                "content@app": {
                    templateUrl: 'app/user/views/System.html',
                    controller: 'SystemCtrl'
                }
            },
            data: {
                title: '系统设置',
                level: 'level_3'
            }
        })
        .state('app.user.recommendUser', {
            url: '/recommendUser',
            views: {
                "content@app": {
                    templateUrl: 'app/user/views/talentpool.html',
                    controller: 'RecommendUserCtrl'
                }
            },
            data: {
                title: '平台人才池',
                level: 'level_6'
            },
            resolve: {
        scripts: function(lazyScript){
            return lazyScript.register([
                'smartadmin-plugin/legacy/jqgrid/js/jquery.jqGrid.js',
                'smartadmin-plugin/legacy/jqgrid/js/i18n/grid.locale-en.js'
            ]);
        }
    }
        })
        .state('app.user.allUser', {
            url: '/allUser',
            views: {
                "content@app": {
                    templateUrl: 'app/user/views/allUser.html',
                    controller: 'AllUserCtrl'
                }
            },
            data:{
                title: '用户列表',
                level: 'level_6'
            },
           
            resolve: {
                scripts: function(lazyScript){
                    return lazyScript.register([
                        'smartadmin-plugin/legacy/jqgrid/js/jquery.jqGrid.js',
                        'smartadmin-plugin/legacy/jqgrid/js/i18n/grid.locale-en.js'
                    ]);
                }
            }
        })
          .state('app.user.allAdmin', {
            url: '/allAdmin',
            views: {
                "content@app": {
                    templateUrl: 'app/user/views/allAdmin.html',
                    controller: 'AllAdminCtrl'
                }
            },
            data:{
                title: '管理员列表',
                level: "level_8"
                // access_level:ACCESS_LEVELS.branch  
            },
            resolve: {
                scripts: function(lazyScript){
                    return lazyScript.register([
                        'smartadmin-plugin/legacy/jqgrid/js/jquery.jqGrid.js',
                        'smartadmin-plugin/legacy/jqgrid/js/i18n/grid.locale-en.js'
                    ]);
                }
            }
        })

         .state('app.user.perUser', {
            url: '/perUser',
            views: {
                "content@app": {
                    templateUrl: 'app/user/views/perUser.html',
                    controller: 'PerUserCtrl'
                }
            },
            data:{
                title: '用户管理',
                access_level:ACCESS_LEVELS.branch  
            },
            resolve: {
                scripts: function(lazyScript){
                    return lazyScript.register([           	
                        'js/bootstrap/bootstrapValidator.min.js',
                        'app/user/modules/shal.js'
                    ]);
                }
            }
           })
            .state('app.user.company', {
            url: '/company',
            views: {
                "content@app": {
                    templateUrl: 'app/user/views/company.html',
                    controller: 'CompanyCtrl'

                   }
            },
            data:{
                title: '公司管理'
               
            }
            })
        
        .state('app.user.profileDemo', {
            url: '/profile',
            data: {
                title: 'Profile'
            },

            views: {
                "content@app": {
                    templateUrl: 'app/app-views/views/profile-demo.html'
                }
            }
        })

       
         //修改密码
         .state('app.user.modifyInformation', {
             url: '/modifyInformation',
             data: {
                 title: '修改个人资料'
             },

             views: {
                 "content@app": {
                     templateUrl: 'app/user/views/modifyInformation.html',
                     controller: 'ModifyInfoCtrl'
                 }
             }
         })
         //手机绑定
          .state('app.user.mobileBinding', {
             url: '/mobileBinding',
             data: {
                 title: '手机绑定'
             },

             views: {
                 "content@app": {
                     templateUrl: 'app/user/views/mobileBinding.html',
                     controller: 'TestJsCtrl'
                 }
             }
         })
           //实名认证
          .state('app.user.realName', {
             url: '/realName',
             data: {
                 title: '实名认证'
             },

             views: {
                 "content@app": {
                     templateUrl: 'app/user/views/realName.html',
                     controller: 'realNameCtrl'
                 }
             }
         })
        .state('app.user.department', {
            url: '/department',
            data: {
                title: '部门',
                level: 'level_6'
            },

            views: {
                "content@app": {
                    templateUrl: 'app/user/views/department.html'
                  
                }
            },
            resolve: {
                scripts: function(lazyScript){
                    return lazyScript.register([
                        'smartadmin-plugin/legacy/jqgrid/js/minified/jquery.jqGrid.min.js',
                        'smartadmin-plugin/legacy/jqgrid/js/i18n/grid.locale-en.js'
                    ]);
                }
            }
        })
            
              

 });


